import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { Response } from './common/response';
import * as session from 'express-session';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);

  app.useGlobalInterceptors(new Response());

  app.use(
    session({
      secret: 'xiao',
      name: 'session.test',
      rolling: true,
      cookie: { maxAge: null },
    }),
  );
  1;

  await app.listen(3000);
}
bootstrap();
